package com.waters321.rock.web.config.handler;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

@ControllerAdvice
@ResponseBody
public class WebExceptionHandler {

  @ExceptionHandler
  @ResponseStatus
  public Object webExceptionHandler(Exception e) {
    e.printStackTrace();
    return e.getMessage();
  }

}
